import { Inject, Injectable } from '@nestjs/common';
import { Todo } from '../../schema/todo.schema';
import { GetAllTodosUseCase } from './usecase.getall';
import { Repository } from '../data/todo-list.repository';

@Injectable()
export class GetAllTodosUseCaseImpl implements GetAllTodosUseCase {
  constructor(@Inject(Repository) private readonly repo: Repository) {}
  async getTodos(): Promise<Todo[]> {
    return this.repo.findAllTodos();
  }
}
